

/****** Object:  StoredProcedure [dbo].[SP_recUser_GridPage_CountData]    Script Date: 05/10/2014 08:28:26 ******/
SET ANSI_NULLS ON
GO

SET QUOTED_IDENTIFIER ON
GO



-- =============================================
-- Author:		Beni Khaeroni (jhung.ben@gmail.com)
-- Create date: 09 Mei 2014 09:35 AM
-- Description:	
-- =============================================
   CREATE PROCEDURE [dbo].[SP_recUser_GridPage_CountData]
    @column  [varchar](50)
   ,@param [varchar] (max)
   AS
   BEGIN
   DECLARE @SQL nvarchar(max);
   SET @SQL ='
    SELECT COUNT('+@column+') FROM master.recUser '
      if (@param  <> '')
      BEGIN
		SET @SQL = @SQL + @param
      END
    exec sp_executesql @SQL
    print @SQL
 END
    
   



GO


